﻿using BCMongoEntity.TMS.Location.Branches;
using MongoDB.Bson;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BCMongoData.TMS.Location.Branches
{
    public interface IBranchesLocationMongoData
    {
        /// <summary>
        /// 获取附近几公里的网点信息
        /// </summary>
        /// <param name="location">指定的经纬度位置</param>
        /// <param name="maxDistance">最大几公里</param>
        /// <param name="query"></param>
        /// <param name="projections"></param>
        /// <returns></returns>
        IEnumerable<BranchesLocationNearEntity> GetGeoNearLocationsByCoordinate(double[] location, int maxDistance, List<BsonElement> query, List<BsonElement> projections);

        /// <summary>
        /// 更新指定的网点信息
        /// </summary> 
        /// <param name="entity">网点信息</param>
        /// <returns></returns>
        BranchesLocationEntity Update(BranchesLocationEntity entity);

        /// <summary>
        /// 添加指定的网点信息
        /// </summary>
        /// <param name="entity">网点信息</param>
        /// <returns></returns>
        BranchesLocationEntity Insert(BranchesLocationEntity entity);

        /// <summary>
        /// 删除指定的网点信息
        /// </summary>
        /// <param name="agentBranchesConfigId">代理商网点配置Id</param>
        void Delete(long agentBranchesConfigId);
    }
}
